<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>date</title>
	<style type="text/css">
		.box{
			width: 800px;
			height: 200px;
			background: #FFFFFF;
		}

		.box2{
			height: 0px;
			width: 0px;
			background: #A349A4;
			border:100px solid #272822 ; 
			border-left: 0px;
			/*border-right: 0px;*/
			border-top: 0px;
		}

		a{
			pasition:fixed;
			bottom:0px;
			right: 0px;
		}
	</style>
</head>
<body>
	<div class="box" id="box">
	
	</div>


	<div class="box2"></div>
		<script type="text/javascript">
			var end_time = "2016/08/15";

			function run () {
				var time1=Math.round((new Date(end_time)).getTime()/1000);
				var time2 = Math.round((new Date()).getTime()/1000);

				var diff = time1-time2;

				var date = Math.floor(diff/86400);

				var housr = Math.floor((diff%86400)/3600);

				var minute =Math.floor(((diff%86400)%3600)/60);

				var second = Math.floor(((diff%86400)%3600)%60);

				str = "距离毕业还有"+date+"天"+housr+"小时"+minute+"分"+second+"秒"

				var box = document.getElementById('box');
				box.innerText=str;
			}

			setInterval(run,1000);









			var box =document.getElementById('box')

			// var width = parseInt(getComputedStyle(box.width));
			// var height =parseInt(grtComputedstyle(box.height));

			var c= 0;

			box.onclick = function (){   				//onclick: 单击鼠标  		触发事件
				if (c==0){
					box.style.backgroundColor="red";
					c=1;
				}else{
					box.style.backgroundColor="#FFFFFF";
					c=0;
				}
			}











		</script>	
</body>
</html>